package com.insigma.yanwenlong.bookkeeping.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.sql.Date;


public class StringToDate {
    public static Date getDate(String s) {
        java.util.Date date = null;
        DateFormat dateFormat = new SimpleDateFormat("yyyy-M-DD");
		try {
			date = dateFormat.parse(s);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		date = java.sql.Date.valueOf(s);
		java.sql.Date sdate = new java.sql.Date(date.getTime());
    	return sdate;
    }
//	public static void main(String[] args) {
//		System.out.println(getDate("2015-5-16"));
//
//	}

}
